home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 July / DPPCPRO0705.ISO / Extras / NetSupport Manager / setup.exe / DIRLST.SCP < prev    next >
Encoding:
Text File  |  2004-10-06  |  2.6 KB  |  81 lines

  1. // Author :        Andy Earp(NetSupport Ltd) 
  2. // File name :         DirLst.scp
  3. // Date created :        17/08/00
  4. // Description : 
  5. //        Small script designed to prompt the user to input the name of the Client they would like to connect to
  6. //        and then print to the output box the number of directories found on the C:\. It will then state the name
  7. //         of each directory found on the Client machine and then disconnect from the Client.
  8.  
  9. Print "*************************************************************"
  10. Print " "
  11. Print "First this script will prompt the user to enter the name"
  12. Print "of the Client they wish to connect to. Next it will" 
  13. Print "display a list of all the Directories found on the "
  14. Print "Client machine and also display the number of"
  15. Print "directories found." 
  16. Wait (7)
  17.  
  18. // Sets the transport to connect over this example is using the TCP/IP protocol
  19.  
  20. SetTransport(T_TCPIP)
  21.  
  22. // Declares the variables
  23.  
  24. Dim Client
  25.  
  26. //Condition is set for the input so that if the cancel button is pressed it will stop the script.
  27.  
  28. If Input ("Please enter the name of the Client machine you would like to connect to: ", Client) = False then
  29.     Print " "
  30.     Print "You have cancelled out of the script"
  31.     Print "*******************************************"
  32.     Stop
  33. Else
  34.  
  35.     Print " "
  36.     Print "Checking Connection to Client: ", Client
  37.     if Connect (Client) then
  38.   
  39.         Print " "   
  40.         Print "Connection successfully made"
  41.         Wait (3)
  42.     
  43.         Dim Dirs
  44.     
  45.         // Finds and prints the number of directories found on the C:\
  46.         Print " "
  47.         Print GetDirList (">C:\", Dirs)," Directories were found on the C:\"
  48.         Print "*******************************************************************"
  49.     
  50.         // Will perform the below loop for every directory found on the C:\
  51.     
  52.         For each Directory in Dirs
  53.         
  54.             // Prints the name of the directory 
  55.         
  56.             Print "Directory  ", Directory
  57.  
  58.         Next
  59.  
  60.         wait (5)
  61.         Print " "
  62.         Print "Disconnecting from Client: ", Client
  63.         wait (2)
  64.         Disconnect (Client)
  65.     Else
  66.         Print " "
  67.         Print "Could not connect to the Client!"
  68.         Print "Please check the Client is available"
  69.         Wait (2) 
  70.     Endif
  71.  
  72.     Print "*********************************************"
  73.     Print " "
  74.     Print "To edit or view the contents of this"
  75.     Print "script right mouse button click"
  76.     Print "on the Script icon and select Edit" 
  77. Endif
  78.  
  79. //Copyright ⌐ 2000
  80.  
  81.